import { routeFormatter } from '@/utils/vue-router-extends/index.js'

export default {
  open(args = {}) {
    const { path = '', query = {} } = routeFormatter(args)

    const url = `/pages/webview/index?path=${JSON.stringify(
      path,
    )}&query=${JSON.stringify(query)}`

    const { type = 'navigateTo', options = {} } = args || {}

    return uni[type]({ ...options, url })
  },
}
